package gee

import (
	"log"
	"time"
)

func Logger() HandlerFunc {
	return func(ctx *Context) {
		// start time
		t := time.Now()
		ctx.Next()
		spend := time.Now().Sub(t).String()
		log.Printf("[%d] %s in %v", ctx.StatusCode, ctx.Request.RequestURI, spend)
	}
}
